---
description: Manage subscriptions on Postgres with Hasura
sidebar_label: Live queries
keywords:
  - hasura
  - docs
  - postgres
  - subscription
  - live queries
slug: index
---

# Postgres: Live Query Subscriptions

## Introduction

A Live query subscription will return the **latest result** of the query being made and not necessarily all the
individual events leading up to the result, such as with a
[streaming subscription](/subscriptions/postgres/streaming/index.mdx).

By default, updates are delivered to clients every **1 sec**.

A live query is a query that is continuously monitored for changes in the database and automatically updates the query
result whenever the underlying data changes. Live queries are a PostgreSQL-specific implementation that allow real-time
updates to clients without the need for manual polling or refreshing.

## Convert a query to a subscription

You can turn any query into a subscription by simply replacing `query` with `subscription` as the operation type.

:::info Single subscription in each query caveat

Hasura follows the [GraphQL spec](https://graphql.github.io/graphql-spec/June2018/#sec-Single-root-field) which allows
for only one root field in a subscription. You also cannot execute multiple separate subscriptions in one query. To have
multiple subscriptions running at the same time they must be in separate queries.

:::

## Use cases

- [Subscribe to the latest value of a particular field](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field)
- [Subscribe to changes to a table’s entries](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table)
- [Subscribe to the latest value of some derived data](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived)
